import unittest, requests


class RegisterPortTest(unittest.TestCase):
    def setUp(self):
        self.session = requests.Session()

    def tearDown(self):
        self.session.close()

    def test_register(self):
        self.session.get(
            url="http://tpshop-test.itheima.net/index.php?m=Home&c=User&a=verify&type=user_reg&r=0.2046365313717471")
        response = self.session.post(url="http://tpshop-test.itheima.net/Home/User/reg.html",
                                     headers={"Content-Type": "application/x-www-form-urlencoded"},
                                     data={"scene": 1, "username": 13866228866, "verify_code": 8888,
                                           "password": 123456, "password2": 123456})
        print(response.json())

